home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / os2 / dsksl091.zip / dskslpub.h < prev    next >
C/C++ Source or Header  |  1997-06-03  |  4KB  |  124 lines

  1. /*
  2.  * $Source: e:/source/driver/sleep/RCS/dskslpub.h,v $
  3.  * $Revision: 1.5 $
  4.  * $Date: 1997/06/03 23:07:52 $
  5.  * $Author: vitus $
  6.  *
  7.  * Describes IOCtl interface to dsksleep.flt
  8.  *
  9.  * $Log: dskslpub.h,v $
  10.  * Revision 1.5  1997/06/03 23:07:52  vitus
  11.  * Removed syntax error
  12.  *
  13.  * Revision 1.4  1997/04/05 01:56:25  vitus
  14.  * Expanded QUERY_VERSION to return additional bitfield
  15.  *
  16.  * Revision 1.3  1997/03/03 01:21:15  vitus
  17.  * Added DSKSL_MSGS_* IOCtls and structure
  18.  *
  19.  * Revision 1.2  1997/02/26 01:49:54  vitus
  20.  * Added SET/QUERY_DEVSTATE, Changed timeout units to seconds
  21.  *
  22.  * Revision 1.1  1997/02/06 01:07:05  vitus
  23.  * Initial revision
  24.  * -------------------------------------------
  25.  * This code is Copyright Vitus Jensen 1996-97
  26.  */
  27.  
  28. #if !defined(_DSKSLPUB_H)
  29. #define _DSKSLPUB_H
  30. #pragma pack(1)                    /* all structures packed */
  31.  
  32.  
  33. /*
  34.  * IOCtl category and function codes
  35.  */
  36. #define IOCTL_DSKSLEEP_CATEGORY    0xC0        /* a user-defined category */
  37. #define DSKSL_QUERY_VERSION    0x60        /* returns version and more */
  38. #define DSKSL_QUERY_TIMEOUT    0x61        /* return device list */
  39. #define DSKSL_SET_TIMEOUT    0x41        /* changes single entry */
  40. #define DSKSL_QUERY_DEVSTATE    0x62        /* stopped? */
  41. #define DSKSL_SET_DEVSTATE    0x42        /* stop now! */
  42. #define DSKSL_READ_MSGS        0x63        /* read startup messages */
  43. #define DSKSL_CLEAR_MSGS    0x43        /* forget all messages */
  44.  
  45.  
  46.  
  47. /* Describes installed DSKSleep.flt */
  48. typedef struct _DSKSL_VER_DATA {
  49.     USHORT    version;            /* as in PC-DOS */
  50.     USHORT    flags;                /* BIT0: registered */
  51. } DSKSL_VER_DATA;
  52.  
  53.  
  54.  
  55. /* Defines device settings */
  56. typedef struct _DEVICE_TIMEOUT {
  57.     UCHAR    adapter;            /* adapter index */
  58.     UCHAR    unit;                /* unit index */
  59.     UCHAR    reserved[2];            /* (padding) */
  60.     ULONG    seconds;            /* 0 -> no sleep */
  61. } DEVICE_TIMEOUT;
  62.  
  63.  
  64.  
  65. /* Returned by DSKSL_QUERY_TIMEOUT */
  66. typedef struct _DSKSL_QL_DATA {
  67.     USHORT        cb;            /* byte count driver wants
  68.                            to return (may be larger
  69.                            than application buffer) */
  70.     UCHAR        reserved[2];        /* (padding) */
  71.     DEVICE_TIMEOUT    list[1];        /* some compiler don't
  72.                            support '[]' ... */
  73. } DSKSL_QL_DATA, * PDSKSL_QL_DATA;
  74.  
  75.  
  76.  
  77. /* Passed to DSKSL_SET_TIMEOUT */
  78. typedef struct _DSKSL_SETTO_PARM {
  79.     USHORT        cb;            /* size of complete structure */
  80.     UCHAR        reserved[2];        /* (padding) */
  81.     DEVICE_TIMEOUT    list[1];        /* see above */
  82. } DSKSL_SETTO_PARM, * PDSKSL_SETTO_PARM;
  83.  
  84.  
  85.  
  86. /* Passed to DSKSL_QUERY_DEVSTATE and DSKSL_SET_DEVSTATE */
  87. typedef struct _DSKSL_DEVSTATE_PARM {
  88.     UCHAR    adapter;            /* adapter index */
  89.     UCHAR    unit;                /* unit index */
  90. } DSKSL_DEVSTATE_PARM, * PDSKSL_DEVSTATE_PARM;
  91.  
  92.  
  93.  
  94. /* Returned from DSKSL_QUERY_DEVSTATE
  95.  * -- x seconds until device is stopped
  96.  * Passed to DSKSL_SET_DEVSTATE
  97.  * -- change current timeout to x seconds
  98.  *    setting this value to 0 will immediately stop the
  99.  *    device.
  100.  *    OBS: any disk I/O will reset the device timeout to it's maximum. */
  101. typedef struct _DSKSL_DEVSTATE_DATA {
  102.     ULONG    seconds;            /* seconds still to go
  103.                            until device is stopped */
  104. } DSKSL_DEVSTATE_DATA, * PDSKSL_DEVSTATE_DATA;
  105.  
  106.  
  107.  
  108. /* Returned by DSKSL_READ_MSGS
  109.  * 'msg' will contain a buffer filled with ASCIIZ strings.  Strings
  110.  * usually don't contain newlines.
  111.  * Some time in the future this buffer might even contain messages
  112.  * added after system startup.
  113.  * To clear the buffer just issue DSKSL_CLEAR_MSGS w/o parameter or
  114.  * data buffer. */
  115. typedef struct _DSKSL_MSGS_DATA {
  116.     USHORT    cb;                /* byte count driver wants
  117.                            to return */
  118.     char    msg[1];                /* some compiler don't
  119.                            support '[]' */
  120. } DSKSL_MSGS_DATA;
  121.  
  122. #pragma pack()
  123. #endif /* _DSKSLPUB_H */
  124.